import { createRouter, createWebHashHistory } from 'vue-router'
// import Layout from '@/views/Layout/Layout.vue'
// import Login from '@/views/Login/Login.vue'
// import Home from '@/views/Home/Home.vue'
// import Category from '@/views/Category/Category.vue'

const routes = [
  {
    path: '/',
    name: 'Layout',
    component: () => import('@/views/Layout/Layout.vue'),
    children: [
      {
        path: '',
        name: 'home',
        component: () => import('@/views/Home/Home.vue')
      },
      {
        path: '/category/:id',
        name: 'category',
        component: () => import('@/views/Category/Category.vue')
      },
      {
        path: '/goods/:id',
        name: 'goods',
        component: () => import('@/views/goods/goods.vue')
      },
      {
        path: '/cart',
        name: 'cart',
        component: () => import('@/views/Cart/Cart.vue')
      },
      {
        path: '/Settlement',
        name: 'Settlement',
        component: () => import('@/views/Settlement/Settlement.vue')
      },
      {
        path: '/pay',
        name: 'pay',
        component: () => import('@/views/Pay/Pay.vue')
      },
      {
        path: '/pay/callback',
        name: 'callback',
        component: () => import('@/views/Pay/Callback.vue')
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/Login/Login.vue')
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
